﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using Devices;
using Devices.Arkray;

namespace DevicesWPF.UCDevices
{
    /// <summary>
    /// UCFF_6450.xaml 的交互逻辑
    /// </summary>
    public partial class UCARKRAY_RT_4010 : UserControl, IUCConfig
    {
        RT_4010 info;
        public UCARKRAY_RT_4010()
        {
            InitializeComponent();
        }
        public UCARKRAY_RT_4010(RT_4010 _info)
        {
            InitializeComponent();
            this.info = _info;
        }

        /// <summary>
        /// 读取配置
        /// </summary>
        /// <param name="hasErrors"></param>
        /// <returns></returns>
        public Config GetConfig(out int hasErrors)
        {
            hasErrors = 0;
            RT_4010Config config = (RT_4010Config)info.Config;
            config.CurrentConnectType = ConnectType.RS_232;
            config.SerialPortConfig = ucSerialPortConfig1.GetSerialPortConfig();
            return config;
        }

        private void NewUCNX500IVCConfig_Load(object sender, RoutedEventArgs e)
        {
            if (this.info != null)
                this.ucSerialPortConfig1.LoadData(((RT_4010Config)info.Config).SerialPortConfig);
        }
    }
}
